<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bai 2.18</title>
</head>

<body>
<?php
	if(isset($_POST['so']))
	{
		$cuuchuong="";
		$so=$_POST['so'];
		if($so>0&&$so<11)
		{
			for($i=1;$i<11;$i++)
			{
				$cuuchuong.="$so x $i = ".($so*$i)."<br />";
			}
		}
		else
			$thongbao="Nhập số từ 1-10";
	}		
?>
<form id="form1" name="form1" method="post" action="Bai2_18.php">
  <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="2" bgcolor="#006666" style="text-align: center; color: #FFF; font-weight: bold;">BẢNG CỬU CHƯƠNG</td>
    </tr>
    <tr>
      <td bgcolor="#66CCCC">Cửu chương:</td>
      <td bgcolor="#66CCCC"><input name="so" type="text" id="so" value="<?php echo $_POST['so'];?> " size="5" /> <input type="submit" name="submit" id="submit" value="Thực hiện" /></td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#66CCCC">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#006666" style="text-align: center; color: #FFF; font-weight: bold;">KẾT QUẢ</td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#66CCCC" style="text-align: center"><label><?php echo $cuuchuong;?></label>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#66CCCC" style="text-align: center; color: #F00;"><label><?php echo $thongbao;?></label></td>
    </tr>
  </table>
</form>
</body>
</html>